/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package cn.rengy.auth;


import java.security.Principal;
import java.util.Collection;


public class SimpleAuthenInfo implements Authentication {

    /**
     * The principals identifying the account associated with this AuthenticationInfo instance.
     */
    protected Principal principal;
    /**
     * The credentials verifying the account principals.
     */
    protected Object credentials;


    /**
     * Default no-argument constructor.
     */
    public SimpleAuthenInfo() {
    }

    public SimpleAuthenInfo(Principal principal, Object credentials, String realmName) {
        this.principal=principal;
        this.credentials = credentials;
    }







    public Principal getPrincipal() {
        return principal;
    }

    @Override
    public boolean isAuthenticated() {
        return false;
    }

    @Override
    public void setAuthenticated(boolean isAuthenticated) {

    }

    public void setPrincipal(Principal principal) {
        this.principal = principal;
    }

    public Object getCredentials() {
        return credentials;
    }

    @Override
    public Collection getAuthorities() {
        return null;
    }

    /**
     * Sets the credentials that verify the principals/identity of the associated Realm account.
     *
     * @param credentials attribute(s) that verify the account's identity/principals, such as a password or private key.
     */
    public void setCredentials(Object credentials) {
        this.credentials = credentials;
    }




}
